﻿@model blogDemo.Models.artic

@{
    ViewBag.Title = "修改";
}

<div class="container">
    <div class="row">
        <div class="col-md-10 col-md-offset-1">
            <form action="/admin/Edit/" class="form-horizontal" method="post">
                @Html.AntiForgeryToken()
                @Html.ValidationSummary(true)

                @Html.HiddenFor(model => model.ID)
                @Html.HiddenFor(model => model.author)
                @Html.HiddenFor(model => model.views)
                @Html.HiddenFor(model => model.date)

                <fieldset>
                    <legend><h2>修改</h2></legend>
                    <div class="control-group">
                        <label class="control-label" for="input01">标题</label>
                        <div class="controls">
                            <input type="text" name="title" id="title" class="input-xlarge" id="input01" value="@Model.title">
                            <p class="help-block">输入标题</p>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="input01">标签</label>
                        <div class="controls">
                            <input type="text" id="label" name="label" class="input-xlarge" id="input01" value="@Model.label">
                            <p class="help-block">输入该文章的标签</p>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="input01">内容</label>
                        <div class="controls">
                            <!-- 加载编辑器的容器 -->
                            <textarea id="content" name="content" style="width:800px;height:400px;">@Model.content</textarea>
                            <!-- 编辑器文件 -->
                            <script src="/Scripts/kindeditor/kindeditor-all-min.js" type="text/javascript"></script>
                            <!-- 实例化编辑器 -->
                            <script type="text/javascript">
                                KindEditor.ready(function (K) {
                                    var options = {
                                        uploadJson: '/scripts/kindeditor/asp.net/upload_json.ashx',
                                        fileManagerJson: '/scripts/kindeditor/asp.net/file_manager_json.ashx',
                                        allowFileManager: true
                                    };
                                    window.editor = K.create('#content', options);
                                });
                            </script>
                        </div>
                    </div><br />
                    <input type="submit" value="保存" />
                </fieldset>
            </form>

            <div>
                @Html.ActionLink("返回", "Index")
            </div>
        </div>  <!-- ./col-md-10 -->
    </div>  <!-- ./row -->
</div>  <!-- ./container -->


@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
